//cdn
//<script src="https://unpkg.com/dsbridge@3.1.3/dist/dsbridge.js"></script>
//npm
//npm install dsbridge@3.1.3
var dsBridge=require("dsbridge")

function showRewardVideoAd(args) {
	dsBridge.call("adSdk.showRewardVideoAd", {unitId: args.unitId || "rv1"}, function(result) {
		if (args && args[result.event]) {
			args[result.event](result)
		}
	})
}

function showNativeAd(args) {
	dsBridge.call("adSdk.showNativeAd", {
		unitId: args.unitId || "n1",
		layout: args.layout,
		margins: args.margins
	}, function(result) {
		if (args && args[result.event]) {
			args[result.event](result)
		}
	})
}

function destroyNativeAd(args) {
	dsBridge.call("adSdk.destroyNativeAd", {unitId: args.unitIdd || "n1"})
}

function showBannerAd(args) {
	dsBridge.call("adSdk.showBannerAd", {
		unitId: args.unitId || "b1",
		layout: args.layout,
		margins: args.margins
	}, function(result) {
		if (args && args[result.event]) {
			args[result.event](result)
		}
	})
}

function destroyBannerAd(args) {
	dsBridge.call("adSdk.destroyBannerAd", {unitId: args.unitId || "b1"})
}

function showInterstitialAd(args) {
	dsBridge.call("adSdk.showInterstitialAd", {unitId: args.unitId || "i1"}, function(result) {
		if (args && args[result.event]) {
			args[result.event](result)
		}
	})
}